<?
DIRECTIVE SAFE_OUTPUT_OPEN;
if(page != null){
?>
<form method="post" name="qPagerForm" target="_self">
<input type="hidden" name="pageSize" value="${page.pageSize!15}" id="pageSize" />
<input type="hidden" name="pageNumber" value="${page.pageNumber!1}" id="pageNumber" />
<a title="首页" href="javascript:turnOverPage(1)">首页</a>
<?if(page.pageNumber!1 <= 1 || page.totalPage!1 <= 1){?>
<span class="pg-item pg-nav-item pg-pre"><a href='javascript:void(0);' title='上一页' class='navbutton'>上一页</a></span>
<?} else {?>
<span class="pg-item pg-nav-item pg-pre"><a title="${page.pageNumber!2 - 1}" href="javascript:turnOverPage(${page.pageNumber!2 - 1})">上一页</a></span> 
<?}?>
<?
var pageNumber = page.pageNumber;
if( page.totalPage > 8){ //总页数大于8
	if( pageNumber > 8 ){  //当前页大于8
		for(var i = ( pageNumber - 8 ); i < pageNumber; i++){
			if(pageNumber == (i+1)) {
			?>
				<span class='pg-item pg-item-current'><span class='current'>${i+1}</span></span>
			<?} else {?>
				<span class="pg-item"><a title="${i+1}" href="javascript:turnOverPage(${i+1})">${i+1}</a></span>
			<?}
		}
	}else{ //当前页小于8
		for(var i = 0; i < pageNumber; i++){
	?>
			<span class="pg-item"><a title="${i+1}" class="navbutton" href="javascript:turnOverPage(${i+1})">${i+1}</a></span>
		<?}
	}
}else{
	for(var i = 0;i < page.totalPage; i++) {
		if(pageNumber == (i+1)) {
	?>
			<span class='pg-item pg-item-current'><span class='current'>${i+1}</span></span>
		<?}else {?>
			<span class="pg-item"><a title="${i+1}" class="navbutton" href="javascript:turnOverPage(${i+1})">${i+1}</a></span>
		<?}
	}
}
?>
<?if(page.pageNumber >= page.totalPage){?>
<span class="pg-item pg-nav-item pg-next"><a href='javascript:void(0);' title='下一页' class='navbutton'>下一页</a></span>
<?} else {?>
<span class="pg-item pg-nav-item pg-next"><a title="${page.pageNumber + 1}" href="javascript:turnOverPage(${page.pageNumber + 1})">下一页</a></span>
<?}?>
<a title="尾页" href="javascript:turnOverPage(${page.totalPage})">尾页</a>
</form>
<script language="javascript">
  function turnOverPage(no){
    if(no > ${page.totalPage}){
    	no=${page.totalPage};
   	}
    if(no < 1){
    	no=1;
    }
    $("#pageNumber").val(no);
    $("form[name=qPagerForm]").submit();
  }
</script>
<?}
DIRECTIVE SAFE_OUTPUT_CLOSE;
?>